package com.jeasonzhao.report.vml.chart;

import com.jeasonzhao.report.vml.base.BaseElement;
import com.jeasonzhao.report.vml.base.Oval;
import com.jeasonzhao.report.vml.base.Rect;
import com.jeasonzhao.report.vml.chart.enums.NodeTypes;
import com.jeasonzhao.report.vml.contrib.Diamond;
import com.jeasonzhao.report.vml.contrib.DiamondAngle;
import com.jeasonzhao.report.vml.contrib.FiveStar;
import com.jeasonzhao.report.vml.contrib.Triangle;


public class NodeHelper
{
    private NodeHelper()
    {
        super();
    }

    public static BaseElement getNodeVml(NodeTypes nodeTypes)
    {
        if(null == nodeTypes)
        {
            return null;
        }
        BaseElement ret = null;
        if(NodeTypes.Diamond.equals(nodeTypes))
        {
            return new Diamond();
        }
        else if(NodeTypes.DiamondAngle.equals(nodeTypes))
        {
            return new DiamondAngle();
        }
        else if(NodeTypes.Oval.equals(nodeTypes))
        {
            return new Oval();
        }
        else if(NodeTypes.Rectangle.equals(nodeTypes))
        {
            return new Rect();
        }
        else if(NodeTypes.FiveStar.equals(nodeTypes))
        {
            return new FiveStar();
        }
        else if(NodeTypes.Triangle.equals(nodeTypes))
        {
            return new Triangle();
        }
        return ret;
    }
}
